import request from '@/utils/request'

export function getListApi(data) {
  return request({
    url: '/activity/pageInfo',
    method: 'post',
    data
  })
}

export function saveApi(data) {
  return request({
    url: '/activity/save',
    method: 'post',
    data
  })
}

export function changeStateApi(data) {
  return request({
    url: '/activity/changeState',
    method: 'post',
    data
  })
}

export function deleteActivityApi(data) {
  return request({
    url: '/activity/batchDelete',
    method: 'post',
    data
  })
}

export function getDetailApi(id) {
  return request({
    url: `/activity/detail/${id}`,
    method: 'post',
  })
}

export function getEnrollListApi(data) {
  return request({
    url: `/enroll/pageInfo`,
    method: 'post',
    data
  })
}

export function getActivityListApi(data) {
  return request({
    url: '/activity/pageInfo',
    method: 'post',
    data
  })
}

export function getClockInListApi(data) {
  return request({
    url: `/clockIn/list/${data.activityId}/${data.userId}`,
    method: 'POST',
    data
  })
}

export function deleteClockInListApi(data) {
  return request({
    url: `/clockIn/delete/${data.clockInId}`,
    method: 'POST',
    data
  })
}
